<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>
<body>
<nav th:replace="layouts::navbar"></nav>

<div class="container-fluid">
    <form th:action="@{/commodities/save}" th:object="${commodity}" method="POST">

        <input type="hidden" th:field="${commodity.commodityId}">
        <div class="logo"></div>
        <hr>

        <label for="name">商品名称：</label>
        <input type="text"  id="name" th:field="*{name}">
        <span th:if="${#fields.hasErrors('name')}" th:errors="${commodity.name}"></span>

<!--        商品名称：<select  th:field="*{kind}">-->
<!--                    <option th:each="kind : ${allKinds}" th:value="${kind.kindId}" th:text="${kind.type}"></option>-->
<!--                </select>-->

        <label for="date">生产日期：</label>
        <input type="text" id="date" th:field="*{date}">
        <span th:if="${#fields.hasErrors('date')}" th:errors="${commodity.date}"></span>
        <label for="number">商品数量：</label>
        <input type="text" id="number" th:field="*{number}">
<!--        <span th:if="${#fields.hasErrors('number')}" th:errors="${commodity.number}"></span>-->
        <label for="price">商品单价：</label>
        <input type="text" id="price" th:field="*{price}">
<!--        <span th:if="${#fields.hasErrors('price')}" th:errors="${commodity.price}"></span>-->




        <button type="submit">新增商品</button>
    </form>
</div>
</body>
</html>